<?php

namespace dingdong\service;

trait EventTrait
{
    /**
     * 连接退出
     * @param $sessionId
     */
    public function onExit($sessionId): void
    {

    }

    /**
     * 处理socket消息
     * @param $sessionId
     * @param $data
     * @param $ws
     */
    public function onMessage($sessionId, $data, $ws): void
    {
        $msg = json_decode($data, true);

        switch ($msg['cmd']) {

        }
    }
}